import { useMount } from 'ahooks';
import { lazy, useState } from 'react'

const common = ({ config }) => {
    const { logSelect, signSelect } = config
    const [Template, setTemplate] = useState()
    const [SignTemp, setSignTemp] = useState()

    useMount(() => {
        setTemplate(lazy(() => import(`../../View/Login/${logSelect}.jsx`)))
        setSignTemp(lazy(() => import(`../../View/SignUp/${signSelect}.jsx`)))
    })

    if (Template && SignTemp) {
        return <Template SignBox={SignTemp} btnText='登录' />
    }
};

export default common;